﻿@model IEnumerable<Common.Order>

@{
    ViewBag.Title = "Order";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
s
<h2>Order</h2>

<script type = "text/javascript">

    function generateTicket() {
        $('#btnGenerate').click(function () {
            $.post("/Authentication/FaultAuthentication")
        })
    }

</script>

<fieldset>
    @Ajax.ActionLink("Generate Ticket", "GenerateTicket", new AjaxOptions() { HttpMethod = "POST"})
</fieldset>

<table>
    <tr>
        <th>
            Username
        </th>
        <th>
            PurchaseDate
        </th>       
    </tr>
    <tr>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Username)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.PurchaseDate)
        </td>        
    </tr>
    <tr>
        <th>
            @Html.Action("OrderDetails", "Partial", new { orderID = item.ID })
        </th>
    </tr>
}

</table>
